package base_02_clone;

/**
 * 深拷贝
 *
 * @author <a href="mailto:sjj@jianzhimao.com">mojo</a>
 * copyright (C), 2013-2022, 广州九尾信息科技有限公司
 * @date 2022/2/8 18:23
 */
public class DeepCopyDemo {
    public static void main(String[] args) throws CloneNotSupportedException {
        User u1 = new User("mojo", 11);
        Teacher teacher = new Teacher();
        teacher.setName("老师1");
        u1.setTeacher(teacher);
        User u2 = (User) u1.clone();
        System.out.println(u1);
        System.out.println(u2);
    }
}
